This guide details how to set up a lightweight, persistent WebDAV server on macOS using rclone. It configures the server to be accessible on the local network (subnet), require a username and password, run on a custom port, and automatically start in the background when logging into the Mac.
Before making the server permanent, it's good practice to test the command to ensure it runs as expected.
rclone serve webdav /Users/zsk009/Public --addr 0.0.0.0:9000 --user myuser --pass mypassword
serve webdav: Instructs rclone to spin up a WebDAV server./Users/zsk009/Public: The absolute path to the directory being shared.--addr 0.0.0.0:9000: Binds the server to all network interfaces (0.0.0.0) on port 9000, making it accessible to other devices on the LAN.--user & --pass: Sets the authentication credentials.Note: You can find your Mac's local IP address to connect from other devices by running ipconfig getifaddr en0.
To run the server in the background, start it automatically on login, and restart it if it crashes, we use a macOS launchd Property List (.plist) file.
Run the following command to find exactly where rclone is installed on your system:
which rclone
(Common paths are /opt/homebrew/bin/rclone or /usr/local/bin/rclone)
Create a new configuration file in your user's LaunchAgents directory:
nano ~/Library/LaunchAgents/com.zsk009.webdav.plist
Paste the following XML into the file. Important: Verify that the first <string> under ProgramArguments matches the output of your which rclone command.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.zsk009.webdav</string>
<key>ProgramArguments</key>
<array>
<!-- Absolute path to rclone executable -->
<string>/opt/homebrew/bin/rclone</string>
<string>serve</string>
<string>webdav</string>
<!-- The folder to share -->
<string>/Users/zsk009/Public</string>
<string>--addr</string>
<string>0.0.0.0:9000</string>
<string>--user</string>
<string>myuser</string>
<string>--pass</string>
<string>mypassword</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardErrorPath</key>
<string>/Users/zsk009/Library/Logs/rclone-webdav.log</string>
<key>StandardOutPath</key>
<string>/Users/zsk009/Library/Logs/rclone-webdav.log</string>
</dict>
</plist>
Save and exit (Ctrl+O, Return, Ctrl+X if using nano).
Once the .plist file is created, you use launchctl to manage the background process.
launchctl load ~/Library/LaunchAgents/com.zsk009.webdav.plist
launchctl unload ~/Library/LaunchAgents/com.zsk009.webdav.plist
tail -f ~/Library/Logs/rclone-webdav.log